package com.example.extension.biz.enums;

import java.util.HashMap;
import java.util.Map;

public enum TtCodeEnum {

    /**
     * 交易类型
     */
    PA("11", "采购协议"),
    PO("12", "采购订单"),
    PORN("13", "采购收货通知单"),
    POR("14", "采购收货单"),
    RETURN("15", "采购退货订单"),
    RPOS("16", "采购退货单"),
    PR("19", "标准付款申请"),
    TRANSFER("22", "标准库存调拨"),
    SO("32", "销售订单"),
    SORN("33", "销售发货通知单"),
    SOS("34", "销售发货单"),
    RETURNSO("35", "销售退货订单"),
    RED("41", "赎货申请单"),
    PN("65", "加工通知单"),
    PC("60", "加工委托单"),
    WLYD("5602", "物流运单");
    //数据库定义的枚举编号
    public static final String ENUM_CODE = "TtCodeEnum";
    private static Map<String, TtCodeEnum> enum_map = new HashMap<String, TtCodeEnum>();

    static {
        for (TtCodeEnum as : TtCodeEnum.values()) {
            enum_map.put(as.code, as);
        }
    }

    public static TtCodeEnum getByCode(String code) {
        return enum_map.get(code);
    }

    /**
     * 类型编码
     */
    private String code;

    /**
     * 描述
     */
    private String desc;

    /**
     * @return 类型编码
     */
    public String getCode() {
        return code;
    }

    /**
     * @return 描述
     */
    public String getDesc() {
        return desc;
    }

    private TtCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
